﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using Xiucai.BPM.Core;
using Xiucai.BPM.Core.Bll;
using Xiucai.BPM.Core.Dal;
using Xiucai.BPM.Core.Model;
using Xiucai.Common;
using Omu.ValueInjecter;
using Xiucai.Common.Data.SqlServer;
using System.Data.SqlClient;
using System.Data;
using Xiucai.Common.Data;
namespace Xiucai.BPM.Admin.Dev.ashx
{
    /// <summary>
    /// Dev 的摘要说明
    /// </summary>
    public class DevCon : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.AddHeader("Access-Control-Allow-Origin", "*"); 
            var json = HttpContext.Current.Request["json"];
            var rpm = new RequestParamModel<Xiucai.BPM.Core.Model.DevConfig>(context) { CurrentContext = context, Action = context.Request["action"] };
            if (!string.IsNullOrEmpty(json))
            {
                rpm = JSONhelper.ConvertToObject<RequestParamModel<Xiucai.BPM.Core.Model.DevConfig>>(json);
                rpm.CurrentContext = context;
            }
            switch (rpm.Action)
            {               
                case "getmylist":
                    var xqhid = PublicMethod.GetString(rpm.Request("XQHID"));
                    string devp = DevConfigBll.Instance.GetDevListByPhone(xqhid);
                    context.Response.Write(devp);
                    break;               
            }
        }
       


        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}